<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.20"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libxlsxwriter: lxw_format Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libxlsxwriter
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.20 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">lxw_format Struct Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Struct to represent the formatting properties of an Excel format.  
 <a href="structlxw__format.html#details">More...</a></p>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Formats in <code>libxlsxwriter</code> are accessed via this struct.</p>
<p>The members of the <a class="el" href="structlxw__format.html" title="Struct to represent the formatting properties of an Excel format.">lxw_format</a> struct aren't modified directly. Instead the format properties are set by calling the functions shown in <a class="el" href="format_8h.html" title="Functions and properties for adding formatting to cells in Excel.">format.h</a>.</p>
<p>For example:</p>
<div class="fragment"><div class="line"><span class="comment">// Create the Format.</span></div>
<div class="line"><a class="code" href="structlxw__format.html">lxw_format</a> *format = <a class="code" href="workbook_8h.html#a279a5d7075d09a3931aae9782afede33">workbook_add_format</a>(workbook);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Set some of the format properties.</span></div>
<div class="line"><a class="code" href="format_8h.html#a85e1b0baf44b445b65894e48722aec14">format_set_bold</a>(format);</div>
<div class="line"><a class="code" href="format_8h.html#a61981b2080bfe6381ede5358ee05b05c">format_set_font_color</a>(format, <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a>);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Use the format to change the text format in a cell.</span></div>
<div class="line"><a class="code" href="worksheet_8h.html#ac208046e7a6d12cc87982422efa41b31">worksheet_write_string</a>(worksheet, 0, 0, <span class="stringliteral">&quot;Hello&quot;</span>, format);</div>
</div><!-- fragment --> <dl class="section examples"><dt>Examples</dt><dd><a class="el" href="anatomy_8c-example.html#_a4">anatomy.c</a>, <a class="el" href="chart_area_8c-example.html#_a1">chart_area.c</a>, <a class="el" href="chart_bar_8c-example.html#_a1">chart_bar.c</a>, <a class="el" href="chart_clustered_8c-example.html#_a1">chart_clustered.c</a>, <a class="el" href="chart_column_8c-example.html#_a1">chart_column.c</a>, <a class="el" href="chart_data_labels_8c-example.html#_a4">chart_data_labels.c</a>, <a class="el" href="chart_data_table_8c-example.html#_a1">chart_data_table.c</a>, <a class="el" href="chart_data_tools_8c-example.html#_a1">chart_data_tools.c</a>, <a class="el" href="chart_doughnut_8c-example.html#_a1">chart_doughnut.c</a>, <a class="el" href="chart_line_8c-example.html#_a1">chart_line.c</a>, <a class="el" href="chart_pattern_8c-example.html#_a5">chart_pattern.c</a>, <a class="el" href="chart_pie_8c-example.html#_a1">chart_pie.c</a>, <a class="el" href="chart_radar_8c-example.html#_a1">chart_radar.c</a>, <a class="el" href="chart_scatter_8c-example.html#_a1">chart_scatter.c</a>, <a class="el" href="chartsheet_8c-example.html#_a1">chartsheet.c</a>, <a class="el" href="comments2_8c-example.html#_a4">comments2.c</a>, <a class="el" href="conditional_format1_8c-example.html#_a6">conditional_format1.c</a>, <a class="el" href="conditional_format2_8c-example.html#_a6">conditional_format2.c</a>, <a class="el" href="data_validate_8c-example.html#_a1">data_validate.c</a>, <a class="el" href="dates_and_times01_8c-example.html#_a4">dates_and_times01.c</a>, <a class="el" href="dates_and_times02_8c-example.html#_a5">dates_and_times02.c</a>, <a class="el" href="dates_and_times03_8c-example.html#_a5">dates_and_times03.c</a>, <a class="el" href="demo_8c-example.html#_a4">demo.c</a>, <a class="el" href="diagonal_border_8c-example.html#_a4">diagonal_border.c</a>, <a class="el" href="format_font_8c-example.html#_a5">format_font.c</a>, <a class="el" href="format_num_format_8c-example.html#_a5">format_num_format.c</a>, <a class="el" href="hyperlinks_8c-example.html#_a4">hyperlinks.c</a>, <a class="el" href="merge_range_8c-example.html#_a4">merge_range.c</a>, <a class="el" href="merge_rich_string_8c-example.html#_a4">merge_rich_string.c</a>, <a class="el" href="outline_8c-example.html#_a4">outline.c</a>, <a class="el" href="outline_collapsed_8c-example.html#_a1">outline_collapsed.c</a>, <a class="el" href="panes_8c-example.html#_a4">panes.c</a>, <a class="el" href="rich_strings_8c-example.html#_a4">rich_strings.c</a>, <a class="el" href="tutorial2_8c-example.html#_a4">tutorial2.c</a>, <a class="el" href="tutorial3_8c-example.html#_a6">tutorial3.c</a>, and <a class="el" href="worksheet_protection_8c-example.html#_a4">worksheet_protection.c</a>.</dd>
</dl>
</div></div><!-- contents -->
<div class="ttc" id="aformat_8h_html_a85e1b0baf44b445b65894e48722aec14"><div class="ttname"><a href="format_8h.html#a85e1b0baf44b445b65894e48722aec14">format_set_bold</a></div><div class="ttdeci">void format_set_bold(lxw_format *format)</div><div class="ttdoc">Turn on bold for the format font.</div></div>
<div class="ttc" id="astructlxw__format_html"><div class="ttname"><a href="structlxw__format.html">lxw_format</a></div><div class="ttdoc">Struct to represent the formatting properties of an Excel format.</div><div class="ttdef"><b>Definition:</b> format.h:358</div></div>
<div class="ttc" id="aworksheet_8h_html_ac208046e7a6d12cc87982422efa41b31"><div class="ttname"><a href="worksheet_8h.html#ac208046e7a6d12cc87982422efa41b31">worksheet_write_string</a></div><div class="ttdeci">lxw_error worksheet_write_string(lxw_worksheet *worksheet, lxw_row_t row, lxw_col_t col, const char *string, lxw_format *format)</div><div class="ttdoc">Write a string to a worksheet cell.</div></div>
<div class="ttc" id="aformat_8h_html_abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec"><div class="ttname"><a href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a></div><div class="ttdeci">@ LXW_COLOR_RED</div><div class="ttdef"><b>Definition:</b> format.h:217</div></div>
<div class="ttc" id="aformat_8h_html_a61981b2080bfe6381ede5358ee05b05c"><div class="ttname"><a href="format_8h.html#a61981b2080bfe6381ede5358ee05b05c">format_set_font_color</a></div><div class="ttdeci">void format_set_font_color(lxw_format *format, lxw_color_t color)</div><div class="ttdoc">Set the color of the font used in the cell.</div></div>
<div class="ttc" id="aworkbook_8h_html_a279a5d7075d09a3931aae9782afede33"><div class="ttname"><a href="workbook_8h.html#a279a5d7075d09a3931aae9782afede33">workbook_add_format</a></div><div class="ttdeci">lxw_format * workbook_add_format(lxw_workbook *workbook)</div><div class="ttdoc">Create a new Format object to formats cells in worksheets.</div></div>
<!-- HTML footer for doxygen 1.8.20-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Copyright 2014-2020 John McNamara.
Generated by&#160;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20
</small></address>
</body>
</html>
